package org.lanqiao.tjut.control;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.lanqiao.tjut.bean.SchClassBean;
import org.lanqiao.tjut.bean.TeacherBean;
import org.lanqiao.tjut.service.ServiceFactory;

public class QueryAllClassInfo extends HttpServlet {

	private static final long serialVersionUID = 1L;

	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		
		TeacherBean teaBean = (TeacherBean) request.getSession().getAttribute("LoginedUserT");
		
		//将老师未选的课程查询出来
		//查询老师未选的所有课程
		List<SchClassBean> lst=ServiceFactory.getSelectClassManagerServiceInstance().TeaSelectClass(teaBean);
	
		
		// 将需要显示的结果(查询的所有用户信息)存入session缓存中
		request.getSession().setAttribute("lst", lst);

		// 跳转到相应页面进行显示
		request.getRequestDispatcher("SelectClass/SelectClassT.jsp").forward(request, response);
	}

	@Override
	public void destroy() {
		// TODO Auto-generated method stub
		super.destroy();
	}

	@Override
	public void init() throws ServletException {
		// TODO Auto-generated method stub
		super.init();
	}

}
